#include <iostream>     // std::cout
#include <algorithm>    // std::sort
#include <vector>       // std::vector

using namespace std;

bool myfunction (int i, int j) { return (i < j); }

struct myclass {
	bool operator() (int i, int j) { return (i < j);}
} myobject;

int main () {
	int myints[] = { 32, 71, 12, 45, 26, 80, 53, 33 };
	vector<int> v(myints, myints + 8);

	// using default comparison (operator <):
	sort(v.begin(), v.begin() + 4);

	// using function as comp
	sort(v.begin() + 4, v.end(), myfunction);

	// using object as comp
	sort(v.begin(), v.end(), myobject);

	// print out content
	for (auto it = v.begin(); it != v.end(); it++)
		cout << *it << ' ';
	cout << '\n';

	return 0;
}
